library(readr)
library(magick)
library(tidyverse)Assignment #5
1 Assignment details
In class, we wrangled and cleaned yield monitor data from a field in 2017.
Now, you are asked to perform the same wrangling and cleaning steps on yield monitor data from the same field but collected in 2019 and 2020.
These data sets need to be downloaded from the course GitHub page. They are located in the 03_data as csv files (03_yield19.csv and 04_yield20.csv). Copy them from the downloaded GitHub folder and paste into your data folder of project 07_yieldmonitor.
As part of the assignment, you will need to:
- Wrangle and clean each of the two data sets
- Provide me with a statistical summary of the cleaned version (including min, mean, max, sd, cv) to be included in the answers portion of this document (below).
- Export the cleaned version to file (save it to the data folder of your 07_yieldmonitor project).
Some tips:
- You can duplicate the wrangling and editing scripts we developed in class, renaming each of the copies to something like yield19_wrangling.qmd and yield19_editor.qmd for the 2019 data as an example. You can do the same for the 2020 data too.
Use these copied scripts as a template to adapt for each of the new data sets.
The Dry_Yield and Speed columns are not named the same in these two new data sets, you will need to accommodate this in your code.
Deadline is Monday Feb 23th 11:59 pm (we will use all 3 cleaned yield data on our next class period).
2 Set up
3 Questions
3.1 1. What is the min, mean, max, and cv for the cleaned yield data from 2019?
clean_yield19_summary = read_csv("../ouput/clean_yield19_summary.csv") %>%
mutate(Value = sprintf("%.2f", Value))
clean_yield19_summary# A tibble: 5 × 2
Variable Value
<chr> <chr>
1 min 31.66
2 mean 1673.43
3 max 3348.77
4 sd 620.37
5 cv 37.07
3.2 2. Create a map of the cleaned yield data from 2019, including the map elements of north arrow and scale, and coloring points according to yield using a colorblind-friendly color scale.
clean_yieldmap19 = image_read("../ouput/clean_yieldmap19.png")
print(clean_yieldmap19, info = FALSE)3.3 3. What is the min, mean, max, and cv for the cleaned yield data from 2020?
clean_yield20_summary = read_csv("../ouput/clean_yield20_summary.csv") %>%
mutate(Value = sprintf("%.2f", Value))
clean_yield20_summary# A tibble: 5 × 2
Variable Value
<chr> <chr>
1 min 279.42
2 mean 1114.71
3 max 1891.97
4 sd 291.78
5 cv 26.18
3.4 4. Create a map of the cleaned yield data from 2020, including the map elements of north arrow and scale, and coloring points according to yield using a colorblind-friendly color scale.
clean_yieldmap20 = image_read("../ouput/clean_yieldmap20.png")
print(clean_yieldmap20, info = FALSE)After answering all questions, include your last name on the file name (e.g., A5-questions-Bastos.qmd), render it, and submit the .html on eLC by Monday, Feb 23th 11:59 pm.